package com.example.demo.controller;

import com.example.demo.entity.MbtiQuestion;
import com.example.demo.service.MbtiQuestionService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/mbti")
@CrossOrigin
public class MbtiQuestionController {

    @Autowired
    private MbtiQuestionService mbtiQuestionService;

    @Operation(summary = "获取所有MBTI测试题")
    @GetMapping("/questions")
    public List<MbtiQuestion> getQuestions() {
        return mbtiQuestionService.getAllQuestions();
    }
}
